package com.cetc.baidumaptest;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;


public class MainActivity extends AppCompatActivity implements View.OnClickListener {
    Button button_click_listener = null;
    Button button_two_point_line = null;
    Button button_two_point_Rectangle = null;
    Button button_Rectangle_Out = null;
    Button button_circle = null;
    Button button_circle_out = null;
    Button button_polygon =null;
    Button button_polygon_out = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        button_click_listener = (Button) findViewById(R.id.go_click_listener);
        button_two_point_line = (Button) findViewById(R.id.go_two_point_line);
        button_two_point_Rectangle = (Button) findViewById(R.id.go_two_point_rectangle);
        button_Rectangle_Out = (Button) findViewById(R.id.rectangle_out);
        button_circle = (Button)findViewById(R.id.go_circle);
        button_circle_out =(Button)findViewById(R.id.circle_out);
        button_polygon = (Button)findViewById(R.id.go_polygon);
        button_polygon_out = (Button)findViewById(R.id.polygon_out);

        button_click_listener.setOnClickListener(this);
        button_two_point_line.setOnClickListener(this);
        button_two_point_Rectangle.setOnClickListener(this);
        button_Rectangle_Out.setOnClickListener(this);
        button_circle.setOnClickListener(this);
        button_circle_out.setOnClickListener(this);
        button_polygon.setOnClickListener(this);
        button_polygon_out.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.go_click_listener:
                Intent intent1 = new Intent(this, ClickListenerActivity.class);
                startActivity(intent1);
                break;
            case R.id.go_two_point_line:
                Intent intent2 = new Intent(this, TwoPointLineActivity.class);
                startActivity(intent2);
                break;
            case R.id.go_two_point_rectangle:
                Intent intent3 = new Intent(this, TwoPointRectangle.class);
                startActivity(intent3);
                break;
            case R.id.rectangle_out:
                Intent intent4 = new Intent(this, RectangleOut.class);
                startActivity(intent4);
                break;
            case R.id.go_circle:
                Intent intent5 = new Intent(this, CircleActivity.class);
                startActivity(intent5);
                break;
            case R.id.circle_out:
                Intent intent6 = new Intent(this, CircleOutActivity.class);
                startActivity(intent6);
                break;
            case R.id.go_polygon:
                Intent intent7 = new Intent(this, Polygon.class);
                startActivity(intent7);
                break;
            case R.id.polygon_out:
                Intent intent8 = new Intent(this, Polygon.class);
                startActivity(intent8);
                break;
            default:
                break;
        }
    }
}
